import request from '@/utils/request'

// 获取医生列表
export function getDoctorList(params) {
  return request({
    url: '/api/doctor/list',
    method: 'get',
    params
  })
}

// 新增医生
export function addDoctor(data) {
  return request({
    url: '/api/doctor',
    method: 'post',
    data
  })
}

// 更新医生信息
export function updateDoctor(data) {
  return request({
    url: '/api/doctor',
    method: 'put',
    data
  })
}

// 删除医生
export function deleteDoctor(id) {
  return request({
    url: `/api/doctor/${id}`,
    method: 'delete'
  })
}

// 认证医生
export function authDoctor(id) {
  return request({
    url: `/api/doctor/auth/${id}`,
    method: 'put'
  })
}

// 医生认证
export function certificationDoctor(id, status) {
  return request({
    url: `/api/doctor/certification/${id}`,
    method: 'put',
    params: { status }
  })
}

// 更新医生状态
export function updateDoctorStatus(id, status) {
  return request({
    url: `/api/doctor/${id}/status`,
    method: 'put',
    data: { status }
  })
}

// 添加医生排班
export function addDoctorSchedule(data) {
  return request({
    url: '/api/doctor/schedule',
    method: 'post',
    data
  })
}

// 获取医生统计数据
export function getDoctorStats() {
  return request({
    url: '/api/admin/doctors/stats',
    method: 'get'
  })
}
